<h1>DefineText2</h1>

<p>DefineText2 defines one or more lines of transparent text. It extends the 
functionality provided by the DefineText instruction by supporting transparent 
colours. The characters, style and layout information is defined using Text 
objects. DefineText2 acts as a container for the text, defining the bounding 
rectangle that encloses the text along with a coordinate transform that can be 
used to change the size and orientation of the text when it is displayed.</p>

<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Size</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">type</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">10</td>
<td>Identifies the DefineText instruction when it is encoded. It is encoded 
with the length field as a 16-bit integer (Little-endian byte order).</td>
</tr>

<tr>
<td nowrap valign="top">length</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">6</td>
<td>The length in bytes of the body of the instruction when it is encoded. If the length is greater 
than 62 then this field is set to 0x3F and the length is encoded using the 
extendedLength field. Encoded with the type field as a 16-bit integer.</td>
</tr>

<tr>
<td nowrap valign="top">extendedLength</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">32</td>
<td>Optional. Contains the length in bytes of the encoded instruction if it is
greater than 62 bytes. If the length is 62 bytes or less then this field is 
omitted.</td>
</tr>

<tr>
<td nowrap valign="top">identifier</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">16</td>
<td>A unique number that identifies the definition within the Flash file.</td>
</tr>

<tr>
<td nowrap valign="top">bounds</td>
<td nowrap valign="top">Bounds</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>A bounding rectangle for the entire block of text.</td>
</tr>

<tr>
<td nowrap valign="top">transform</td>
<td nowrap valign="top">CoordTransform</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>A coordinate transform describing the placement, size and rotation of the text block.</td>
</tr>

<tr>
<td nowrap valign="top">lines</td>
<td nowrap valign="top">Text[n]</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>An array of Text data structures describing the characters to be displayed 
and their attributes.</td>
</tr>

<tr>
<td nowrap valign="top">endOfText</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">8</td>
<td>A zero byte marking the end of the array of Text data structures.</td>
</tr>

</table>

<p>The bounding rectangle and transform controls how the text is laid out. Each 
Text object in the textRecords array specifies an offset from the left and bottom 
edges of the bounding rectangle, allowing successive lines of text to be arranged 
as a block or paragraph. The coordinate transform can be used to control the 
size and orientation of the text when it is displayed.</p>

<h2>History</h2>

<p>The DefineText2 instruction represents the DefineText tag from the Macromedia 
Flash (SWF) File Format Specification. It was introduced in Flash 3.</p>
